package mymodel

import (
	"devops-super/internal/model/entity"
)

// AlertPeopleToScene 联系人与告警场景关联数据传输对象
type AlertPeopleToScene struct {
	PeopleId uint64 `json:"peopleId" v:"required#人员ID不能为空"`
	SceneId  int64  `json:"sceneId" v:"required#告警场景ID不能为空"`
}

// ToEntity 将AlertPeopleToScene转换为实体
func (m *AlertPeopleToScene) ToEntity() *entity.AlertPeopleToScene {
	return &entity.AlertPeopleToScene{
		PeopleId: m.PeopleId,
		SceneId:  m.SceneId,
	}
}

// AlertDeviceToScene 设备与告警场景关联数据传输对象
type AlertDeviceToScene struct {
	DeviceNo string `json:"deviceNo" v:"required#deviceNo不能为空"`
	SceneId  int64  `json:"sceneId" v:"required#告警场景ID不能为空"`
}

// ToEntity 将AlertDeviceToScene转换为实体
func (m *AlertDeviceToScene) ToEntity() *entity.AlertDeviceToScene {
	return &entity.AlertDeviceToScene{
		DeviceNo: m.DeviceNo,
		SceneId:  m.SceneId,
	}
}

// AlertDeviceGroupToScene 设备分组与告警场景关联数据传输对象
type AlertDeviceGroupToScene struct {
	DeviceGroupId uint64 `json:"deviceGroupId" v:"required#设备分组ID不能为空"`
	SceneId       int64  `json:"sceneId" v:"required#告警场景ID不能为空"`
}

// ToEntity 将AlertDeviceGroupToScene转换为实体
func (m *AlertDeviceGroupToScene) ToEntity() *entity.AlertDevicegroupToScene {
	return &entity.AlertDevicegroupToScene{
		DeviceGroupId: m.DeviceGroupId,
		SceneId:       m.SceneId,
	}
}
